<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page
	import="com.sun.org.apache.bcel.internal.generic.INSTANCEOF,com.moment.model.InstrumentBankData"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN"
	dir="ltr">
<head>
<title>Moment Mobile Payments</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="imagetoolbar" content="no" />
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/styles/layout.css" type="text/css" />
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<style>
.control-label {
	display: inline-block;
	width: 250px;
}

.control-group {
	padding-bottom: 10px;
}
</style>


</head>
<body id="top">
	<%@include file="loggedinheader.jsp"%>
	<%@ page import="org.json.*"%>
	<%@ page import="com.moment.model.*"%>
	<%@page import="com.moment.webservice.*"%>
	<%@page import="com.moment.util.Converter"%>
	<%@page import="java.util.HashMap"%>
	<%@page import="java.util.Map"%>
	<%@ page language="java" contentType="text/html; charset=UTF-8"
		pageEncoding="UTF-8"%>
	<%@page import="java.util.*"%>
	<%!String s[];%>
	<%!String saving, current;%>
	You are not logged in
	<br />
	<a href="index.jsp">Please Login</a>
	<jsp:useBean id="userObj" class="com.moment.model.UserReg"
		scope="session" />
	<div class="wrapper col3">

		<div id="intro">
			<div id="logout">
				<a href="/MMP/LogoutController"><img
					src="<%=request.getContextPath()%>/images/logout.png" alt="Logout" /></a>
			</div>
			<div class="fl_left1">

				<div id="login1">
					<div class="imgl">
						<img alt="Embedded Image" height="128" width="128"
							src="data:image/jpeg;base64,<jsp:getProperty name="userObj" property="imagestr" />" />
					</div>
				</div>
				<div id="instrumentsmain">
					<div>

						<h2>
							<center>
								<span id="viewedit">View</span> Cashier
							</center>
						</h2>
					</div>

					<jsp:useBean id="cashierObj" class="com.moment.model.CashierData"
						scope="session" />


					<form action="../CashierController" method="post">


						<div class="control-group">
							<label class="control-label" for="cname">Name : </label> <input
								type="text" class="formelement" size="27" name="cname"
								id="cname" value="<%=cashierObj.getName()%>" /><label
								class="viewform"><%=cashierObj.getName()%></label><span
								style="display: none;" class="help-inline">Please enter
								numeric values only.</span>

						</div>

						<div class="control-group">
							<label class="control-label" for="clocation">Location : </label>
							<select id="clocation" name="clocation" class="formelement">
								<%
									//--New CODE-------------
																				Map<String, String> map = new HashMap<String, String>();
																				map.put("method", "17");
																				map.put("mnum", (String) session.getAttribute("username"));

																				String json = new Converter().mapToJson(map);
																				System.out.println("json String :" + json);
																				Services serviceproxy = new ServicesProxy();

																				String location = serviceproxy.service(json);
																				LocationData locationData=new LocationData();
																				locationData.setLocationlist(location);
																				String[] location_details = locationData.getLocationlist().split("-");
																				for(String s:location_details)
																				{
																			        	   String select = "";
																			        	   if(s.equalsIgnoreCase(cashierObj.getLocationName()))
																			        	   {
																			        		   select = "selected='selected'";   
																			        	   }
																						out.println("<option value='"+s+"' "+select+">"+s+"</option>");
																					}
								%>
							</select><label class="viewform"><%=cashierObj.getLocationName()%></label></label><span
								style="display: none;" class="help-inline">Please enter
								numeric values only.</span>

						</div>
						<div class="control-group">
							<label class="control-label" for="cnum">Mobile Number : </label>
							<input type="text" size="27" class="formelement" name="cnum"
								id="cnum" value="<%=cashierObj.getCashierno()%>" /><label
								class="viewform"><%=cashierObj.getCashierno()%></label><span
								style="display: none;" class="help-inline">Please enter
								numeric values only.</span>

						</div>
						<div class="control-group">
							<div class="formelement">
								<label class="control-label" for="password">New Password
									: </label> <input type="password" class="formelement" size="27"
									name="cpassword" id="cpassword" /><span style="display: none;"
									class="help-inline">Please enter numeric values only.</span>
							</div>
						</div>

						<div class="control-group">
							<div class="formelement">
								<label class="control-label" for="password">Retype New
									Password : </label> <input type="password" class="formelement"
									size="27" name="cpassword1" id="cpassword1" /><span
									style="display: none;" class="help-inline">Please enter
									numeric values only.</span>
							</div>
						</div>

						<div class="fl_right">
							<input type="submit" class="myButton formelement" value="Update" />
							<input type="hidden" name="ctype" value="update" /> <input
								type="hidden" name="cid" value="<%=cashierObj.getCashierid()%>" />
							<input type="hidden" name="mid" value="<%=cashierObj.getmId()%>" />
							<input type="button" class="myButton viewform" id="editform"
								onclick="showform();" class="myButton" value="Edit" />
						</div>
					</form>




				</div>

			</div>
		</div>
	</div>
	<br class="clear" />


	<%@include file="footer.jsp"%>

	<script>
		$("document").ready(function() {
			$(".formelement").hide();
		});
		function showform() {
			$(".viewform").hide();
			$(".formelement").show();
			$("#viewedit").html("Edit");
			return false;

		}
	</script>
</body>
</html>

